package timerservice;
import java.util.Timer;
/**
 * ��定时器
 * */
public class SwTimer extends Timer{
  public SwTimer() {
  }
  public void schedule(SwTimerTask task){
    if(task.getFirstDate()!=null){
      if(task.getPeriod()>0){
        this.schedule(task,task.getFirstDate(),task.getPeriod());
      }else{
        this.schedule(task,task.getFirstDate());
      }
    }else{
      if(task.getDelay()>0){
        this.schedule(task,task.getDelay(),task.getPeriod());
      }else{
        this.schedule(task,task.getDelay());
      }
    }
  }
}